package com.haoze.nurseapp.controller;

import com.haoze.common.response.Result;
import com.haoze.common.response.ResultGenerator;
import com.haoze.nurseapp.service.NurseFileIndexService;
import com.haoze.nurseapp.service.NurseTeamService;
import com.haoze.nurseapp.vo.EmrFile;
import com.haoze.nurseapp.vo.NurseTeamDutyVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/nurseapp/nurseFileIndex")
@Api(value = "任务流文书", tags = "任务流文书")
public class NurseFileIndexController {

    @Autowired
    NurseFileIndexService nurseFileIndexService;

    @GetMapping("/getFileIndex")
    public EmrFile getFileIndex(@RequestParam("emrFileId") String emrFileId) {
        return nurseFileIndexService.getFileIndex(emrFileId);
    }

    @GetMapping("/getFileIndexReturnResult")
    public Result getFileIndexReturnResult(@RequestParam("emrFileId") String emrFileId) {
        return ResultGenerator.genOkResult(nurseFileIndexService.getFileIndex(emrFileId));
    }

    @PostMapping(value = "/save")
    public String saveFileIndex(@RequestBody EmrFile emrFile){
        return nurseFileIndexService.saveFileIndex(emrFile);
    }

    @GetMapping("/getSpeedUnit")
    public Result getSpeedUnit() {
        return ResultGenerator.genOkResult(nurseFileIndexService.getSpeedUnit());
    }

    @GetMapping("/getFileByQrCode")
    public Result getFileByQrCode(@RequestParam String qrCode) {
        return nurseFileIndexService.getFileByQrCode(qrCode);
    }
}
